package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class Copy2Demo {
    public static void main(String[] args) throws IOException {
        FileInputStream ins = new FileInputStream("C:\\Users\\DELL\\Desktop\\10001.jpg");
        FileOutputStream ons = new FileOutputStream("C:\\Users\\DELL\\Desktop\\10002.jpg");
        int len;
        byte[] bytes = new byte[1024*10];
        long start = System.currentTimeMillis();
        while ((len = ins.read(bytes))!=-1){
            ons.write(bytes,0,len);
        }
        System.out.println("复制完毕，耗费时间："+(System.currentTimeMillis()-start));
        ins.close();
        ons.close();
    }
}
